package com.imcode.setdemo;

public class Order implements Comparable<Order> {

    private String orderNumber;//订单编号

    public Order(String orderNumber) {
        this.orderNumber = orderNumber;
    }

    public String getOrderNumber() {
        return orderNumber;
    }

    public void setOrderNumber(String orderNumber) {
        this.orderNumber = orderNumber;
    }


    @Override
    public int compareTo(Order o) {
        System.out.println("compareTo: " + o.orderNumber);
        // 按订单的字典顺序排序
        int r = this.orderNumber.compareTo(o.orderNumber);
        return r;
    }
}
